inherited fmKadry: TfmKadry
  Left = 211
  Top = 130
  Width = 956
  Height = 617
  Caption = 'fmKadry'
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 556
    Width = 948
  end
  inherited Panel1: TPanel
    Width = 948
    inherited BitBtn1: TBitBtn
      Left = 778
    end
    inherited BitBtn2: TBitBtn
      Left = 866
    end
  end
  object dbgClients: TcxGrid [2]
    Left = 0
    Top = 45
    Width = 948
    Height = 276
    Align = alTop
    TabOrder = 2
    LookAndFeel.Kind = lfStandard
    object dbgClientsDBTableView1: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      DataController.DataSource = dlgDS
      DataController.Summary.DefaultGroupSummaryItems = <
        item
          Kind = skCount
          Position = spFooter
          FieldName = 'PLASTNAME'
        end>
      DataController.Summary.FooterSummaryItems = <
        item
          Kind = skCount
          FieldName = 'FIO'
        end>
      DataController.Summary.SummaryGroups = <>
      DataController.Summary.Options = [soNullIgnore]
      FilterRow.InfoText = #1065#1077#1083#1082#1085#1080#1090#1077' '#1079#1076#1077#1089#1100' '#1076#1083#1103' '#1089#1086#1079#1076#1072#1085#1080#1103' '#1092#1080#1083#1100#1090#1088#1072
      NewItemRow.InfoText = #1065#1105#1083#1082#1085#1080#1090#1077' '#1079#1076#1077#1089#1100' '#1076#1083#1103' '#1076#1086#1073#1072#1074#1083#1077#1085#1080#1103' '#1085#1086#1074#1086#1081' '#1089#1090#1088#1086#1082#1080
      OptionsBehavior.CellHints = True
      OptionsBehavior.ImmediateEditor = False
      OptionsBehavior.IncSearch = True
      OptionsCustomize.ColumnFiltering = False
      OptionsCustomize.ColumnGrouping = False
      OptionsData.Deleting = False
      OptionsData.Editing = False
      OptionsData.Inserting = False
      OptionsSelection.CellSelect = False
      OptionsSelection.HideFocusRectOnExit = False
      OptionsSelection.InvertSelect = False
      OptionsSelection.UnselectFocusedRecordOnExit = False
      OptionsView.NavigatorOffset = 10
      OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
      OptionsView.ColumnAutoWidth = True
      OptionsView.DataRowHeight = 24
      OptionsView.ExpandButtonsForEmptyDetails = False
      OptionsView.Footer = True
      OptionsView.GroupByBox = False
      OptionsView.Indicator = True
      Preview.Visible = True
      Styles.Content = DMInv.cxData
      Styles.IncSearch = DMInv.cxKrasniyText
      Styles.Selection = DMInv.cxJoltiyFon
      Styles.Header = DMInv.cxSiniyText
      object dbgClientsDBTableView1PP: TcxGridDBColumn
        Caption = #1060#1048#1054
        DataBinding.FieldName = 'PP'
        Width = 117
      end
      object dbgClientsDBTableView1SDNAME: TcxGridDBColumn
        Caption = #1057#1090#1072#1090#1091#1089
        DataBinding.FieldName = 'SDNAME'
        Width = 42
      end
      object dbgClientsDBTableView1MED_STRAH: TcxGridDBColumn
        Caption = #1052#1077#1076'. '#1089#1090#1088#1072#1093'.'
        DataBinding.FieldName = 'MED_STRAH'
        PropertiesClassName = 'TcxCheckBoxProperties'
        Properties.ValueChecked = 1
        Properties.ValueUnchecked = 0
        Width = 51
      end
      object dbgClientsDBTableView1TRUD_DOG: TcxGridDBColumn
        Caption = #1058#1088#1091#1076'. '#1076#1086#1075'.'
        DataBinding.FieldName = 'TRUD_DOG'
        PropertiesClassName = 'TcxCheckBoxProperties'
        Properties.ValueChecked = 1
        Properties.ValueUnchecked = 0
        Width = 51
      end
      object dbgClientsDBTableView1TRUD_KNIGA: TcxGridDBColumn
        Caption = #1058#1088#1091#1076'. '#1082#1085'.'
        DataBinding.FieldName = 'TRUD_KNIGA'
        PropertiesClassName = 'TcxCheckBoxProperties'
        Properties.ValueChecked = 1
        Properties.ValueUnchecked = 0
        Width = 51
      end
      object dbgClientsDBTableView1MED_KNIGA: TcxGridDBColumn
        Caption = #1052#1077#1076'. '#1082#1085'.'
        DataBinding.FieldName = 'MED_KNIGA'
        PropertiesClassName = 'TcxCheckBoxProperties'
        Properties.ValueChecked = 1
        Properties.ValueUnchecked = 0
        Width = 51
      end
      object dbgClientsDBTableView1PENS_POLIS: TcxGridDBColumn
        Caption = #1055#1077#1085#1089'. '#1087#1086#1083#1080#1089
        DataBinding.FieldName = 'PENS_POLIS'
        PropertiesClassName = 'TcxCheckBoxProperties'
        Properties.ValueChecked = 1
        Properties.ValueUnchecked = 0
        Width = 52
      end
      object dbgClientsDBTableView1PRIKAZ: TcxGridDBColumn
        Caption = #1055#1088#1080#1082#1072#1079
        DataBinding.FieldName = 'PRIKAZ'
        PropertiesClassName = 'TcxCheckBoxProperties'
        Properties.ValueChecked = 1
        Properties.ValueUnchecked = 0
        Width = 51
      end
      object dbgClientsDBTableView1ZAYAVLENIE: TcxGridDBColumn
        Caption = #1047#1072#1103#1074#1083'.'
        DataBinding.FieldName = 'ZAYAVLENIE'
        PropertiesClassName = 'TcxCheckBoxProperties'
        Properties.ValueChecked = 1
        Properties.ValueUnchecked = 0
        Width = 51
      end
      object dbgClientsDBTableView1DIPLOM: TcxGridDBColumn
        Caption = #1044#1080#1087#1083#1086#1084
        DataBinding.FieldName = 'DIPLOM'
        PropertiesClassName = 'TcxCheckBoxProperties'
        Properties.ValueChecked = 1
        Properties.ValueUnchecked = 0
        Width = 51
      end
      object dbgClientsDBTableView1PASSPORT: TcxGridDBColumn
        DataBinding.FieldName = #1055#1072#1089#1087'.'
        PropertiesClassName = 'TcxCheckBoxProperties'
        Properties.ValueChecked = 1
        Properties.ValueUnchecked = 0
        Width = 51
      end
      object dbgClientsDBTableView1ATTEST_KNIGA: TcxGridDBColumn
        Caption = #1040#1090#1090#1077#1089#1090'. '#1082#1085'.'
        DataBinding.FieldName = 'ATTEST_KNIGA'
        PropertiesClassName = 'TcxCheckBoxProperties'
        Properties.ValueChecked = 1
        Properties.ValueUnchecked = 0
        Width = 51
      end
    end
    object dbgClientsLevel1: TcxGridLevel
      GridView = dbgClientsDBTableView1
    end
  end
  inherited dlgDS: TDataSource
    DataSet = qPeople
  end
  object qPeople: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    SQL.Strings = (
      
        'SELECT P.*, (COALESCE(P.PLASTNAME, '#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39 +
        ' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '        SD_sotr.SDNAME,'
      '        IIF(PD3.DID IS NULL,0,1) AS med_strah,'
      '        IIF(PD4.DID IS NULL,0,1) AS trud_dog,'
      '        IIF(PD5.DID IS NULL,0,1) AS trud_kniga,'
      '        IIF(PD6.DID IS NULL,0,1) AS med_kniga,'
      '        IIF(PD7.DID IS NULL,0,1) AS pens_polis,'
      '        IIF(PD8.DID IS NULL,0,1) AS prikaz,'
      '        IIF(PD9.DID IS NULL,0,1) AS zayavlenie,'
      '        IIF(PD10.DID IS NULL,0,1) AS diplom,'
      '        IIF(PD11.DID IS NULL,0,1) AS passport,'
      '        IIF(PD12.DID IS NULL,0,1) AS attest_kniga'
      'FROM PEOPLE P'
      'LEFT OUTER JOIN P_STATUS PSS ON PSS.PID = P.PID'
      'INNER JOIN'
      '('
      'SELECT t1.*'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = 1470'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t1'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'WHERE NOT EXISTS'
      '('
      'SELECT t2.sdid'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = 1470'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t2'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'WHERE t2.sdparid = t1.sdid'
      ')'
      'ORDER BY 2'
      ') AS SD_sotr ON SD_sotr.SDID = PSS.SDID'
      '--'#1084#1077#1076'. '#1089#1090#1088#1072#1093#1086#1074#1082#1072
      
        'LEFT OUTER JOIN P_DOCUMENTS PD3 ON PD3.PID = P.PID AND PD3.DTYPE' +
        ' = 1485 and PD3.DISDELETE is null and PD3.DOSN = 1'
      '--'#1090#1088#1091#1076#1086#1074#1086#1081' '#1076#1086#1075#1086#1074#1086#1088
      
        'LEFT OUTER JOIN P_DOCUMENTS PD4 ON PD4.PID = P.PID AND PD4.DTYPE' +
        ' = 1457 and PD4.DISDELETE is null and PD4.DOSN = 1'
      '--'#1090#1088#1091#1076' '#1082#1085#1080#1075#1072
      
        'LEFT OUTER JOIN P_DOCUMENTS PD5 ON PD5.PID = P.PID AND PD5.DTYPE' +
        ' = 1209 and PD5.DISDELETE is null and PD5.DOSN = 1'
      '--'#1084#1077#1076' '#1082#1085#1080#1078#1082#1072
      
        'LEFT OUTER JOIN P_DOCUMENTS PD6 ON PD6.PID = P.PID AND PD6.DTYPE' +
        ' = 1461 and PD6.DISDELETE is null and PD6.DOSN = 1'
      '--'#1087#1077#1085#1089#1080#1086#1085#1085#1099#1081' '#1087#1086#1083#1080#1089
      
        'LEFT OUTER JOIN P_DOCUMENTS PD7 ON PD7.PID = P.PID AND PD7.DTYPE' +
        ' = 1924 and PD7.DISDELETE is null and PD7.DOSN = 1'
      '--'#1055#1088#1080#1082#1072#1079' '#1086' '#1087#1088#1080#1077#1084#1077' '#1085#1072' '#1088#1072#1073#1086#1090#1091
      
        'LEFT OUTER JOIN P_DOCUMENTS PD8 ON PD8.PID = P.PID AND PD8.DTYPE' +
        ' = 1916 and PD8.DISDELETE is null and PD8.DOSN = 1'
      '--'#1047#1072#1103#1074#1083#1077#1085#1080#1077' '#1086' '#1087#1088#1080#1077#1084#1077' '#1085#1072' '#1088#1072#1073#1086#1090#1091
      
        'LEFT OUTER JOIN P_DOCUMENTS PD9 ON PD9.PID = P.PID AND PD9.DTYPE' +
        ' = 1917 and PD9.DISDELETE is null and PD9.DOSN = 1'
      '--'#1076#1080#1087#1083#1086#1084
      
        'LEFT OUTER JOIN P_DOCUMENTS PD10 ON PD10.PID = P.PID AND PD10.DT' +
        'YPE = 1458 and PD10.DISDELETE is null and PD10.DOSN = 1'
      '--'#1087#1072#1089#1087#1086#1088#1090
      
        'LEFT OUTER JOIN P_DOCUMENTS PD11 ON PD11.PID = P.PID AND PD11.DT' +
        'YPE in (1050,1464,1465) and PD11.DISDELETE is null and PD11.DOSN' +
        ' = 1'
      '--'#1040#1090#1090#1077#1089#1090#1072#1094#1080#1086#1085#1085#1072#1103' '#1082#1085#1080#1078#1082#1072
      
        'LEFT OUTER JOIN P_DOCUMENTS PD12 ON PD12.PID = P.PID AND PD12.DT' +
        'YPE = 1925 and PD11.DISDELETE is null and PD11.DOSN = 1'
      'WHERE P.PISDELETE is null'
      'ORDER BY 3')
    Left = 304
    Top = 1
    object qPeoplePID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPeoplePNAME: TIBStringField
      FieldName = 'PNAME'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object qPeoplePLASTNAME: TIBStringField
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object qPeoplePPATRONYMIC: TIBStringField
      FieldName = 'PPATRONYMIC'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object qPeoplePDATEBIRTH: TDateField
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object qPeoplePSEX: TIntegerField
      FieldName = 'PSEX'
      Origin = '"PEOPLE"."PSEX"'
    end
    object qPeoplePNOTE: TIBStringField
      FieldName = 'PNOTE'
      Origin = '"PEOPLE"."PNOTE"'
      Size = 2048
    end
    object qPeoplePUSERENTER: TIBStringField
      FieldName = 'PUSERENTER'
      Origin = '"PEOPLE"."PUSERENTER"'
      Size = 40
    end
    object qPeoplePTIMEENTER: TDateTimeField
      FieldName = 'PTIMEENTER'
      Origin = '"PEOPLE"."PTIMEENTER"'
    end
    object qPeoplePUSEREDIT: TIBStringField
      FieldName = 'PUSEREDIT'
      Origin = '"PEOPLE"."PUSEREDIT"'
      Size = 40
    end
    object qPeoplePTIMEEDIT: TDateTimeField
      FieldName = 'PTIMEEDIT'
      Origin = '"PEOPLE"."PTIMEEDIT"'
    end
    object qPeoplePISDELETE: TIntegerField
      FieldName = 'PISDELETE'
      Origin = '"PEOPLE"."PISDELETE"'
    end
    object qPeoplePP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qPeopleSDNAME: TIBStringField
      FieldName = 'SDNAME'
      ProviderFlags = []
      Size = 2303
    end
    object qPeopleMED_STRAH: TIntegerField
      FieldName = 'MED_STRAH'
      ProviderFlags = []
    end
    object qPeopleTRUD_DOG: TIntegerField
      FieldName = 'TRUD_DOG'
      ProviderFlags = []
    end
    object qPeopleTRUD_KNIGA: TIntegerField
      FieldName = 'TRUD_KNIGA'
      ProviderFlags = []
    end
    object qPeopleMED_KNIGA: TIntegerField
      FieldName = 'MED_KNIGA'
      ProviderFlags = []
    end
    object qPeoplePENS_POLIS: TIntegerField
      FieldName = 'PENS_POLIS'
      ProviderFlags = []
    end
    object qPeoplePRIKAZ: TIntegerField
      FieldName = 'PRIKAZ'
      ProviderFlags = []
    end
    object qPeopleZAYAVLENIE: TIntegerField
      FieldName = 'ZAYAVLENIE'
      ProviderFlags = []
    end
    object qPeopleDIPLOM: TIntegerField
      FieldName = 'DIPLOM'
      ProviderFlags = []
    end
    object qPeoplePASSPORT: TIntegerField
      FieldName = 'PASSPORT'
      ProviderFlags = []
    end
    object qPeopleATTEST_KNIGA: TIntegerField
      FieldName = 'ATTEST_KNIGA'
      ProviderFlags = []
    end
  end
end
